package com.ruoyi.cms.domain.dto;

import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.Pattern;

import com.ruoyi.cms.domain.CmsTopic;
/**
 * 内容信息对象 cms_topic
 *
 * @author ruoyi
 * @date 2021-07-30
 */
@ApiModel("内容信息对象")
@Data
@Accessors(chain = true)
public class CmsTopicDTO  {

    /** 内容ID - bigint(20) */
    @ApiModelProperty(value = "内容ID（主键.新增时为空,修改时必填!）")
    private Long topicId;

    /** 站点ID - bigint(20) */
    @ApiModelProperty(value = "站点ID", required = false)
    private Long siteId;

    /** 模型ID - bigint(20) */
    @ApiModelProperty(value = "模型ID", required = false)
    private Long modelId;

    /** 栏目ID - bigint(20) */
    @ApiModelProperty(value = "栏目ID", required = false)
    private Long channelId;

    /** 标题 - varchar(100) */
    @ApiModelProperty(value = "标题", required = false)
    @Length(max = 100, message = "标题限制最多100个字符!")
    private String title;

    /** 来源 - varchar(64) */
    @ApiModelProperty(value = "来源", required = false)
    @Length(max = 64, message = "来源限制最多64个字符!")
    private String source;

    /** 发布人 - varchar(64) */
    @ApiModelProperty(value = "发布人", required = false)
    @Length(max = 64, message = "发布人限制最多64个字符!")
    private String publishBy;

    /** 发布时间 - datetime */
    @ApiModelProperty(value = "发布时间", required = false)
    private Date publishTime;

    /** 阅读次数 - bigint(20) */
    @ApiModelProperty(value = "阅读次数", required = false)
    private Long visit;

    /** 审核状态（0未审核 1通过 2不通过） - char(1) */
    @ApiModelProperty(value = "审核状态（0未审核 1通过 2不通过）", required = false)
    @Pattern(regexp = "^$|^(0|1|2)$", message = "审核状态数据格式错误!")
    private String verifyStatus;

    /** 审核人 - varchar(64) */
    @ApiModelProperty(value = "审核人", required = false)
    @Length(max = 64, message = "审核人限制最多64个字符!")
    private String verifyBy;

    /** 审核时间 - datetime */
    @ApiModelProperty(value = "审核时间", required = false)
    private Date verifyTime;

    /** 状态（0正常 1停用） - char(1) */
    @ApiModelProperty(value = "状态（0正常 1停用）", required = false)
    @Pattern(regexp = "^$|^(0|1)$", message = "状态数据格式错误!")
    private String status;

    /** 删除标志（0代表存在 2代表删除） - char(1) */
    @ApiModelProperty(value = "删除标志（0代表存在 2代表删除）", required = false)
    @Pattern(regexp = "^$|^(0|2)$", message = "删除标志数据格式错误!")
    private String delFlag;

    /** 创建人 - varchar(64) */
    @ApiModelProperty(value = "创建人", required = false)
    @Length(max = 64, message = "创建人限制最多64个字符!")
    private String createBy;

    /** 创建时间 - datetime */
    @ApiModelProperty(value = "创建时间", required = false)
    private Date createTime;

    /** 修改人 - varchar(64) */
    @ApiModelProperty(value = "修改人", required = false)
    @Length(max = 64, message = "修改人限制最多64个字符!")
    private String updateBy;

    /** 修改时间 - datetime */
    @ApiModelProperty(value = "修改时间", required = false)
    private Date updateTime;

    @JsonIgnore
    @ApiModelProperty(value = "额外参数", required = false, hidden = true)
    Map<String, Object> params = new HashMap<>();

    /** 构造方法 */
    public CmsTopicDTO() {}

    /** 构造方法 com.ruoyi.cms.domain.CmsTopic  */
    public CmsTopicDTO(CmsTopic data) {
        this.setTopicId(data.getTopicId());
        this.setSiteId(data.getSiteId());
        this.setModelId(data.getModelId());
        this.setChannelId(data.getChannelId());
        this.setTitle(data.getTitle());
        this.setSource(data.getSource());
        this.setPublishBy(data.getPublishBy());
        this.setPublishTime(data.getPublishTime());
        this.setVisit(data.getVisit());
        this.setVerifyStatus(data.getVerifyStatus());
        this.setVerifyBy(data.getVerifyBy());
        this.setVerifyTime(data.getVerifyTime());
        this.setStatus(data.getStatus());
        this.setDelFlag(data.getDelFlag());
        this.setCreateBy(data.getCreateBy());
        this.setCreateTime(data.getCreateTime());
        this.setUpdateBy(data.getUpdateBy());
        this.setUpdateTime(data.getUpdateTime());
    }

    /**
    * 转换为 com.ruoyi.cms.domain.CmsTopic
    */
    public CmsTopic as() {
        CmsTopic data = new CmsTopic();
        data.setTopicId(this.getTopicId());
        data.setSiteId(this.getSiteId());
        data.setModelId(this.getModelId());
        data.setChannelId(this.getChannelId());
        data.setTitle(this.getTitle());
        data.setSource(this.getSource());
        data.setPublishBy(this.getPublishBy());
        data.setPublishTime(this.getPublishTime());
        data.setVisit(this.getVisit());
        data.setVerifyStatus(this.getVerifyStatus());
        data.setVerifyBy(this.getVerifyBy());
        data.setVerifyTime(this.getVerifyTime());
        data.setStatus(this.getStatus());
        data.setDelFlag(this.getDelFlag());
        data.setCreateBy(this.getCreateBy());
        data.setCreateTime(this.getCreateTime());
        data.setUpdateBy(this.getUpdateBy());
        data.setUpdateTime(this.getUpdateTime());
        return data;
    }


}
